//
//  EBMLoginRequestObj.m
//  eBondMall
//
//  Created by apple on 2020/4/22.
//  Copyright © 2020 zhaoshijie. All rights reserved.
//

#import "EBMLoginRequestObj.h"

@implementation EBMLoginRequestObj



/// 图片验证码
/// @param successBlock 成功
/// @param failBlock 失败
+ (void)requestDataInMessageCodeWithSuccessBlock:(void(^)(id result))successBlock
                                       failBlock:(void(^)(void))failBlock
{
    NSString *urlString = Login_verify_verifyCode;
    
    [EBMRequest GETRequestTakeDataWithUrlString:urlString headerDic:nil parameters:nil loadView:KWindow tableView:nil successBlock:^(id result) {
        
        if(successBlock)
        {
            successBlock(result);
        }
        
        
    } serverErrorBlock:nil failBlock:nil];
}




/// 短信验证码
/// @param imageCode 图片验证码code
/// @param imageToken 图片验证码的token
/// @param mobile 手机号码
/// @param successBlock 成功
/// @param failBlock 失败
+ (void)requestDataInMessageCodeWithImageCode:(NSString *)imageCode
                                   imageToken:(NSString *)imageToken
                                       mobile:(NSString *)mobile
                                 successBlock:(void(^)(void))successBlock
                                    failBlock:(void(^)(void))failBlock
{
    
    NSString *urlString = Login_verify_sendVerifySms;
    
    
    NSDictionary *parameters_dic = @{@"code":imageCode,
                                     @"mobile":mobile,
                                     @"token":imageToken
    };
    
    
    [EBMRequest POSTRequestWithUrlString:urlString headerDic:nil parameters:parameters_dic loadView:KWindow tableView:nil successBlock:^(id result) {
        
        
        [MBProgressHUDInLoading MBProgressHUDInTitleWithTitle:@"短信验证码发送成功"];
        
        if(successBlock)
        {
            successBlock();
        }
        
        
    } serverErrorBlock:nil failBlock:nil];
    
    
    
}





@end
